package com.osmap.openstreetmap.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.CheckBox;
import android.widget.TextView;

import com.osmap.openstreetmap.R;
import com.osmap.openstreetmap.bean.FileBeans;

public class FootmarkCleanAdapter extends BaseAdapter {

	private List<FileBeans> mFileList;
	private Context mContext;

	private LayoutInflater mLayoutInflater;

	public FootmarkCleanAdapter(List<FileBeans> mFileList, Context mContext) {
		super();
		this.mFileList = mFileList;
		this.mContext = mContext;
		mLayoutInflater = LayoutInflater.from(mContext);
	}

	@Override
	public int getCount() {
		if (mFileList != null) {
			return mFileList.size();
		} else {
			return 0;
		}

	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			convertView = mLayoutInflater.inflate(R.layout.item_footmark_clean,
					null);
			holder = new ViewHolder();
			holder.cbBox = (CheckBox) convertView.findViewById(R.id.cb_check);
			holder.title = (TextView) convertView.findViewById(R.id.tv_title);

			convertView.setTag(holder);
		}
		holder = (ViewHolder) convertView.getTag();
		holder.title.setText(mFileList.get(position).fileName);
		return convertView;
	}

	class ViewHolder {
		public TextView title;
		public CheckBox cbBox;
	}

}
